package ratonTalk;

import java.util.Calendar;
import java.util.Date;

/**
 * @author ：Dsi
 * @date ：2021/11/18 20:14
 * Describe ：该类用于练习calendar
 */
public class CalendarTest {

    public static void main(String[] args) {
        Calendar c=Calendar.getInstance();
        System.out.println(c);

        Date d=c.getTime();
        System.out.println(d);

        int y=c.get(Calendar.YEAR);
        System.out.println(y);
        int a = c.get(Calendar.MONTH) + 1;
        System.out.println(a);
        int dd=c.get(Calendar.DAY_OF_WEEK)-1;
        System.out.println(dd);
        int yd = c.get(Calendar.DAY_OF_YEAR);
        System.out.println(yd);
        int md = c.get(Calendar.DAY_OF_MONTH);
        System.out.println(md);


    }
}
